<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" sssscontent="ie=edge">
  <link rel="icon" href="">
  <title>hrms_main</title>
  <link rel="stylesheet" type="text/css"
        href="/jquery-easyui-1.3.3/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css"
        href="/jquery-easyui-1.3.3/themes/icon.css">
  <script type="text/javascript"
          src="/jquery-easyui-1.3.3/jquery.min.js"></script>
  <script type="text/javascript"
          src="/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
  <script type="text/javascript">
    var url;

    var queryIndex = location.href.indexOf("?");
    var id;
    if (queryIndex > 0) {
      var queryString = location.href.substring(queryIndex + 1);
      var params = queryString.split("=");
      localStorage.setItem(params[0], params[1]);
      id = params[1];
    }

    function addTab(url, text, iconCls) {
      var content = "<iframe frameborder=0 scrolling='auto' style='width:100%;height:100%' src='"
          + url + "'></iframe>";
      $("#tabs").tabs("add", {
        title: text,
        iconCls: iconCls,
        closable: true,
        content: content
      });
    }

    function openTab(text, url, iconCls) {
      if ($("#tabs").tabs("exists", text)) {
        $("#tabs").tabs("close", text);
        addTab(url, text, iconCls);
        $("#tabs").tabs("select", text);
      } else {
        addTab(url, text, iconCls);
      }
    }

    function logout() {
      $.messager
      .confirm(
          "system prompt",
          "Do you want to exit?",
          function (r) {
            if (r) {
              window.location.href = "admin/logout";
            }
          });
    }

    $(function () {
      $.getJSON(
          "admins/"+id,
          function (result) {
            $("#admin-name").text(result.username);
          });
    });
  </script>
<body class="easyui-layout">
<div region="north" style="height: 78px; background-color: #ffff">
  <table width="100%">
    <tr>
      <td width="50%"></td>
      <td valign="bottom"
          style="font-size: 20px; color: #8B8B8B; font-family: '楷体';"
          align="right" width="50%">
        <a href="javascript:openTab(' Current Admin','currAdmin.html')"
           class="easyui-linkbutton" data-options="plain:true"
           style="width: 350px;"> &nbsp;&nbsp;<font size="3"><strong>Current Admin：</strong>
      </font> <font id="admin-name" color="red"></font></a></td>
    </tr>
  </table>
</div>
<div region="center">
  <div class="easyui-tabs" fit="true" border="false" id="tabs">
    <div title="Home" data-options="iconCls:'icon-home'">
      <div align="center" style="padding-top: 50px">
        <font color="grey" size="10">Human Affairs Management System</font>
      </div>
    </div>
  </div>
</div>
<div region="west" style="width: 200px; height: 500px;"
     title="Navigation Menu" split="true">
  <div class="easyui-accordion">
    <div title="Department Manage"
         data-options="selected:true,iconCls:'icon-shujias'"
         style="padding: 10px; height: 10px;">
      <a href="javascript:openTab(' Department Info','deptManage.html')"
         class="easyui-linkbutton" data-options="plain:true"
         style="width: 150px;"> Department Info</a>
    </div>

    <div title="Position Manage"
         data-options="selected:true,iconCls:'icon-schoolceo'"
         style="padding: 10px; height: 10px;">
      <a href="javascript:openTab(' Position Info','positionManage.html')"
         class="easyui-linkbutton" data-options="plain:true"
         style="width: 150px;"> Position Info</a>
    </div>

    <div title="Employee Manage" data-options="iconCls:'icon-students' "
         style="padding: 10px">
      <a href="javascript:openTab(' Employee Info','employeeManage.html')"
         class="easyui-linkbutton" data-options="plain:true"
         style="width: 150px;">Employee Info</a>
    </div>

    <div title="System Manage" data-options="iconCls:'icon-item'"
         style="padding: 10px; border: none;">
      <a
          href="javascript:openTab(' Admin List','adminManage.html','icon-lxr')"
          class="easyui-linkbutton"
          data-options="plain:true,iconCls:'icon-lxr'" style="width: 150px;">
        Admin List</a><a href="javascript:logout()" class="easyui-linkbutton"
                         data-options="plain:true,iconCls:'icon-exit'" style="width: 150px;">
      Exit</a>
    </div>
  </div>
</div>
</body>
</html>